package com.itheima.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.Students;
import com.itheima.pojo.Students;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
* @author VRMMO
* @description 针对表【students】的数据库操作Mapper
* @createDate 2025-03-26 20:16:29
* @Entity com.itheima.pojo.Students
*/
@Mapper
public interface StudentsMapper {
    /**
     * 分页查询,获取列表数据
     * @param start
     * @param pageSize
     * @return
     */
    @Select("select * from student limit #{start},#{pageSize}")
    public List<Students> page(Integer start, Integer pageSize);

    /**
     * 学生信息查询
     * @return
     */
    //@Select("select * from student")
    public List<Students> list(String name, Short gender, Date birth);

    /**
     * 批量删除
     * @param studentids
     */
    void delete(List<Integer> studentids);

    /**
     * 新增学生
     * @param student
     */
    @Insert("insert into student(name, gender, gradeid, birth) " +
            " values(#{name},#{gender},#{gradeid},#{birth})")
    void insert(Students student);

    /**
     * 根据ID查询学生
     * @param studentid
     * @return
     */
    @Select("select * from student where studentid = #{studentid}")
    Students getById(Integer studentid);

    /**
     * 更新学生
     * @param student
     */
    void update(Students student);


}




